package com.ssyan.builder.improve;

/**
 * @author ssyan
 * @Description TODO
 * @create 2021/8/28 2:54
 * @Version 1.0
 */
public class HouseDirector {

    HouseBuilder houseBuilder = null;

    //构造器传入houseBuilder
    public HouseDirector(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }

    public void setHouseBuilder(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }

    //如何处理构造房子的流程，交给指挥者
    public House constructHouse() {
        houseBuilder.build();
        return houseBuilder.buildHouse();
    }
}
